//
//  TempPlayerController.m
//  JXPlayer
//
//  Created by bijan on 2016/12/13.
//  Copyright © 2016年 bijan. All rights reserved.
//

#import "TempPlayerController.h"
#import "JXPlayer.h"
#import <AVFoundation/AVFoundation.h>

@interface TempPlayerController ()
@property(nonatomic,strong) JXPlayer*player;
@property(nonatomic,strong) UIView *playView;
@end

NSString * const urlStr = @"http://zyvideo1.oss-cn-qingdao.aliyuncs.com/zyvd/7c/de/04ec95f4fd42d9d01f63b9683ad0";

@implementation TempPlayerController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor cyanColor];
    
    self.playView = [[UIView alloc]initWithFrame:CGRectMake(0, 0,self.view.bounds.size.width , 500)];
    
    [self.view addSubview:_playView];
    
    [self initializePlayer];
    
    
}

- (void)initializePlayer{
    
    _player = [JXPlayer sharedPlayer];
    
    [_player playWithUrlStr:urlStr playView:_playView];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc{
    
    [self.player pause];
    [[NSNotificationCenter defaultCenter]postNotificationName:RELEASE_PLAYER object:nil];
    
}



@end
